<#import "spring.ftl" as spring />
<#import "inspector-time-macros.ftl" as imacro />
<html>
<head>
	<title>Schedule your inspection</title>
</head>
<body>
<#include "inspectionDropDownValues.ftl" />
<#include "schedulebreadcrumb.ftl">

<div id="content">

<script type="text/javascript" src="${springMacroRequestContext.contextPath}/js/wz_tooltip.js"></script>
              
	<@imacro.listErrors "criteria" />

	<div id="infoBox">
		<table>
		<tr>
			<td><b>Home Inspector:</b></td>
			<td>${criteria.inspection.inspector.name} of ${criteria.inspection.inspector.company.name}</td>
		</tr>	
		<tr>
			<td><b>Property Address:</b></td>
			<td>${criteria.inspection.property.location.street1}, ${criteria.inspection.property.location.city}</td>
		</tr>
		<tr>
			<td><b>Time of Inspection:</b></td>
			<td>${criteria.inspection.inspectionTime?date} at ${criteria.inspection.inspectionTime?time?string.short}</td>
		</tr>
		<tr>
			<td><b>Inspection Fee:</b></td>
			<td>$${criteria.inspection.inspectionFee}</td>
		</tr>
		</table>	
	</div>
	
	<p>We have calculated your inspection fee based on your property details:<br/>
	<br/><span style="font-size: 1.5em">Inspection Fee: $${criteria.inspection.inspectionFee}</span></p>  

	<form name="scheduleForm"  method="POST">
		<@spring.formHiddenInput "criteria.inspection.inspectionTime"/>
		<input type="hidden" name="inspectorId" value="${criteria.inspection.inspector.id}" />
		
		<table class="formTable twoColForm">
			<tr>
				<td colspan="2">
					<h2>Secondary Home Buyer</h2>
					<p>(Typically the spouse of the primary home buyer.)</p>	
				</td>
			</tr>
			<tr>
				<th>First Name</th>
				<td><@spring.formInput "criteria.secondHomeBuyer.name.first", 'size="25"'/></td>
			</tr>
			<tr>
				<th>Last Name</th>
				<td><@spring.formInput "criteria.secondHomeBuyer.name.last", 'size="25"'/></td>
			</tr>
			<tr>
				<th>Email</th>
				<td><@spring.formInput "criteria.secondHomeBuyer.email", 'size="25"'/></td>
			</tr>
			<tr>
				<th>Contact Phone</th>
				<td><@spring.formInput "criteria.secondHomeBuyer.phone", 'size="25"'/></td>
			</tr>
			<tr>
				<td colspan="2"><h2>Home Buyer Address</h2></td>
			</tr>
			<tr>
				<th>Home Address</th>
				<td><@spring.formInput "criteria.inspection.homeBuyer.address.street1", 'size="25"'/></td>
			</tr>
			<tr>
				<th>City</th>
				<td><@spring.formInput "criteria.inspection.homeBuyer.address.city", 'size="25"'/></td>
			</tr>
			<tr>
				<th>State</th>
				<td>
					<@spring.bind "criteria.inspection.homeBuyer.address.state" />
					<select id="${spring.status.expression}" name="${spring.status.expression}">
						<option value=""<@spring.checkSelected ""/>>-- SELECT STATE --</option>
							<#list allStates as option>
								<option value="${option}"<@spring.checkSelected option/>>${option.longName}</option>
							</#list>
					</select>
				</td>
			</tr>
			<tr>
				<th>Zip</th>
				<td><@spring.formInput "criteria.inspection.homeBuyer.address.zipCode", 'size="10"'/></td>
			</tr>
			<tr>
				<th>Additional Phone</th>
				<td><@spring.formInput "criteria.inspection.homeBuyer.secondaryPhone", 'size="25"'/></td>
			</tr>
			<tr>
				<th>Fax</th>
				<td><@spring.formInput "criteria.inspection.homeBuyer.fax", 'size="25"'/></td>
			</tr>
			<tr>
				<td colspan="2"><h2>Additional Property Information</h2></td>
			</tr>
			<tr>
				<th>Cross Street</th>
				<td><@spring.formInput "criteria.inspection.property.crossStreet", 'size="25"' /></td>
			</tr>
			<tr>
				<th>Subdivision Name</th>
				<td><@spring.formInput "criteria.inspection.property.subdivisionName", 'size="25"'/></td>
			</tr>
			<tr>
				<th>Status</th>
				<td><@spring.formSingleSelect "criteria.inspection.property.occupied", occ/></td>
			</tr>
			<tr>
				<th>Lockbox Type <a class="whatsthis" href="#" onmouseover="TagToTip('lockboxTip')" onmouseout="UnTip()" onclick="return false;">what's this?</a></th>
				<td><@imacro.enumDropDown "criteria.inspection.lockboxType", lockboxTypes /></td>
			</tr>
			<tr>
				<th>Lockbox Realtor Code <span class="labelSubtext">(if you have a lockbox)</span></th>
				<td><@spring.formInput "criteria.inspection.lockboxRealtorCode", 'size="25"'/></td>
			</tr>
			<tr>
				<th>Who Will be Present During Inspection?</th>
				<td><@imacro.enumDropDown "criteria.inspection.presentAtInspection", presentAtInspectionOptions /></td>
			</tr>
			<tr>
				<th>Number of Stories <span class="labelSubtext">(excluding basement)</span></th>
				<td><@spring.formSingleSelect "criteria.inspection.property.numberOfStories", stories /></td>
			</tr>
			<tr>
				<th>Year of Construction</th>
				<td>
					<@spring.bind "criteria.inspection.property.constructionYear" />
					<#if criteria.inspection.property.constructionYear == 0>							
						<input type="text" size="4" maxlength="4" name="${spring.status.expression}" 
							value="" />
					<#else>
						<input type="text" size="4" maxlength="4" name="${spring.status.expression}" 
							value="${spring.status.value?default("")}" />							
					</#if>	
				</td>
			</tr>
			<tr>
				<th>Other Structures <span class="labelSubtext">(detached garage, etc)</span></th>
				<td><@spring.formInput "criteria.inspection.property.otherStructures", 'size="30"' /></td>
			</tr>
			<tr>
				<th>Number of AC Units</th>
				<td><@spring.formSingleSelect "criteria.inspection.property.numberOfAcUnits", acunits /></td>
			</tr>
			<tr>
				<td colspan="2"><h2>Listing Agent</h2></td>
			</tr>
			<tr>
				<th>Agent Name</th>
				<td><@spring.formInput "criteria.inspection.listingAgentName", 'size="25"' /></td>
			</tr>
			<tr>
				<th>Agent Phone Number</th>
				<td><@spring.formInput "criteria.inspection.listingAgentPhoneNumber", 'size="25"' /></td>
			</tr>
		</table>
	

		<div class="bottomNavLayout">
			<a href="schedule2-pi.html" class="navBack">BACK</a>
			<input type="submit" value="CONTINUE" class="navFwd" />
		</div>
		
	</form>
	
	<div id="lockboxTip"><div class="toolTipWindow">A lockbox can be either a "Realtor"-type lockbox that is identified by a 7-character realtor code, or a "Contractor"-type lockbox with an alphanumeric code containing any number of characters.</div></div>
	
</div> <!-- /content -->

</body>
</html>